import { request } from "@/request";

export async function fetchList(params) {
  return await request("/data/page", {
    method: "GET",
    params,
  });
}
export async function fetchListAll(params) {
  return await request("/data/list", {
    method: "GET",
    params,
  });
}

export async function add(data) {
  return await request("/data/add", {
    method: "POST",
    data,
  });
}
export function remove(data) {
  return request("/data/deleteByIds", {
    method: "post",
    data,
  });
}

export function batchResultAdd(data) {
  return request("/data/batchResultAdd", {
    method: "post",
    data,
  });
}
export async function getInfo(params) {
  return await request(`/pore/structure/${params.type.toLowerCase()}/list`, {
    method: "GET",
    params,
  });
}

export async function updatePore(data) {
  return await request(`/pore/structure/${data.type.toLowerCase()}/update`, {
    method: "POST",
    data,
  });
}
export async function addPore(data) {
  return await request(`/pore/structure/${data.type.toLowerCase()}/add`, {
    method: "POST",
    data,
  });
}


export function removePore(data) {
  return request(`/pore/structure/${data.type.toLowerCase()}/deleteByIds`, {
    method: "post",
    data: [data.id],
  });
}

export function exportPore(data) {
  return request(`/pore/structure/${data.type.toLowerCase()}/export`, {
    method: "post",
    data,
  });
}

export async function getYlCurve(data) {
  return await request("/data/ylCurve", {
    method: "POST",
    data,
  });
}
export async function getScCurve(data) {
  return await request("/data/scCurve", {
    method: "POST",
    data,
  });
}
export async function getLhCurve(data) {
  return await request("/data/lhCurve", {
    method: "POST",
    data,
  });
}
